import React from "react";

interface IProp {
    value: number,
    onIncrement: () => void,
    onDecrement: () => void,
    onIncrementAsync: () => void,
}

const Counter = ({
  value,
  onIncrement,
  onDecrement,
  onIncrementAsync,
}: IProp) => (
  <div>
    <button onClick={onIncrement}>增加</button>
    <button onClick={onIncrementAsync}>1s后增加</button>
    <button onClick={onDecrement}>减少</button>
    <hr />
    <div>数量: {value}</div>
  </div>
);

export default Counter;
